home *** CD-ROM | disk | FTP | other *** search
/ PC Home 49 / PC_Home_Issue_49.iso / lldemo / lldemo.shr / ROSETTA.EXE / ROSETTA.DXR / 00608_Sprite scripts.ls < prev    next >
Encoding:
Text File  |  1996-06-24  |  11.0 KB  |  480 lines

  1. on setPlace place, change
  2.   global gPlace
  3.   repeat with i = 1 to 47
  4.     if the puppet of sprite i = 1 then
  5.       alert("setPlace: Puppetsprite not reset!" && x)
  6.       halt()
  7.     end if
  8.   end repeat
  9.   if change = #change then
  10.     set gPlace to place
  11.   end if
  12.   if place = #LOGIN then
  13.     setPuppets("8,12,13,20", 1)
  14.   else
  15.     if place = #title then
  16.       setPuppets("3,8,9,10,11,12,17", 1)
  17.     else
  18.       if place = #menu then
  19.         setPuppets("19,22", 1)
  20.       else
  21.         if place = #play then
  22.           setPuppets("1,6,7,13,15,16,17,18,19,20,21,22,24,25,26,46,47", 1)
  23.         else
  24.           if place = #CREDITS then
  25.             setPuppets("9,10,17", 1)
  26.           else
  27.             if place = #CONTROLS then
  28.               setPuppets("7,10,11,12,13,14,18,19,21,22,24,47", 1)
  29.             else
  30.               if place = #ENDSCREEN then
  31.                 setPuppets("1,10,11,12,13,14,15,16,17,18,19,20,23,47", 1)
  32.               else
  33.                 alert("Illegal value for gPlace: " & place)
  34.                 halt()
  35.               end if
  36.             end if
  37.           end if
  38.         end if
  39.       end if
  40.     end if
  41.   end if
  42.   stopMouseTrap()
  43. end
  44.  
  45. on setPuppets str, check
  46.   set n to the number of items in str
  47.   repeat with i = 1 to n
  48.     if the castNum of sprite value(item i of str) = 0 then
  49.       if check = 1 then
  50.         alert("setPuppets: no sprite exists when setting puppet. " & value(item i of str))
  51.         halt()
  52.       else
  53.       end if
  54.     end if
  55.     puppetSprite(value(item i of str), 1)
  56.   end repeat
  57. end
  58.  
  59. on resetPuppets
  60.   repeat with i = 1 to 47
  61.     puppetSprite(i, 0)
  62.   end repeat
  63. end
  64.  
  65. on highlight x
  66.   set the castNum of sprite x to the castNum of sprite x + 1
  67. end
  68.  
  69. on unhighlight x
  70.   set the castNum of sprite x to the castNum of sprite x - 1
  71. end
  72.  
  73. on setPageArrows enab
  74.   if enab then
  75.     set the castNum of sprite 1 to cast "Panel w/arrows"
  76.   else
  77.     set the castNum of sprite 1 to cast "Panel w/o arrows"
  78.   end if
  79. end
  80.  
  81. on blankResponsePicts
  82.   repeat with i = 0 to 3
  83.     set the castNum of sprite (2 + i) to 341
  84.   end repeat
  85. end
  86.  
  87. on setResponsePicts index
  88.   repeat with i = 0 to 3
  89.     set the castNum of sprite (2 + i) to index + i
  90.     updateStage()
  91.   end repeat
  92. end
  93.  
  94. on setResponsePict which, base
  95.   set the castNum of sprite (2 + which) to base + i
  96. end
  97.  
  98. on setGoalPost pr
  99.   set the locV of sprite 5 to 308 - (pr * 9 / 5)
  100. end
  101.  
  102. on setBorderHighlight c
  103.   set the castNum of sprite 6 to cast c
  104. end
  105.  
  106. on setPos6 sP
  107.   set the locH of sprite 6 to the locH of sprite sP
  108.   set the locV of sprite 6 to the locV of sprite sP
  109. end
  110.  
  111. on hide6
  112.   set the locH of sprite 6 to 1000
  113. end
  114.  
  115. on setShowTextGray
  116.   set the castNum of sprite 7 to cast "gray mode 4 picts"
  117.   set the locH of sprite 7 to the locH of sprite 12
  118.   set the locV of sprite 7 to the locV of sprite 12
  119. end
  120.  
  121. on hideShowTextGray
  122.   set the locH of sprite 7 to 1000
  123. end
  124.  
  125. on hide7
  126.   set the locH of sprite 8 to 1000
  127. end
  128.  
  129. on setChalPict c
  130.   set the castNum of sprite 8 to c
  131. end
  132.  
  133. on showCTextPuppet x
  134.   set the locH of sprite 8 to x
  135. end
  136.  
  137. on setChallengeText
  138.   set the locH of sprite 10 to the left of sprite 8 + 5
  139. end
  140.  
  141. on hide9
  142.   set the locH of sprite 10 to 1000
  143. end
  144.  
  145. on setTextPuppetPos which
  146.   if (which = 1) or (which = 3) then
  147.     set the locH of sprite (7 + which) to 5
  148.   else
  149.     set the locH of sprite (7 + which) to 225
  150.   end if
  151. end
  152.  
  153. on showTextPuppet i
  154.   set the locH of sprite (7 + i) to the left of sprite (1 + i) + 15
  155. end
  156.  
  157. on showTextPuppets
  158.   repeat with i = 1 to 4
  159.     showTextPuppet(i)
  160.   end repeat
  161. end
  162.  
  163. on hideTextPuppet which
  164.   set the locH of sprite (7 + which) to 1000
  165. end
  166.  
  167. on hideTextPuppets
  168.   repeat with i = 1 to 4
  169.     hideTextPuppet(i)
  170.   end repeat
  171. end
  172.  
  173. on setVolButton x
  174.   set the locV of sprite 10 to 300 - (x * 14)
  175. end
  176.  
  177. on setChallengePict x
  178.   set the castNum of sprite 12 to x
  179. end
  180.  
  181. on highlightChalSpeaker
  182.   highlight(13)
  183. end
  184.  
  185. on unhighlightChalSpeaker
  186.   unhighlight(13)
  187. end
  188.  
  189. on setBlindfoldIcon blind
  190.   if blind then
  191.     set the castNum of sprite 13 to 210
  192.   else
  193.     set the castNum of sprite 13 to 205
  194.   end if
  195. end
  196.  
  197. on setChalSpeaker SNDCHAL
  198.   if SNDCHAL = #UPLEFT then
  199.     set the locH of sprite 13 to 3
  200.     set the locV of sprite 13 to 46
  201.   else
  202.     if SNDCHAL = #ONPCT then
  203.       set h to the locH of sprite 12 - (the width of sprite 12 / 2) + 1
  204.       set v to the locV of sprite 12 + (the height of sprite 12 / 2) - 2
  205.       set the locH of sprite 13 to h
  206.       set the locV of sprite 13 to v
  207.     else
  208.       if SNDCHAL = #NONE then
  209.         set the locH of sprite 13 to 1000
  210.       else
  211.         alert("Illegal value for setChalSpeaker: " & SNDCHAL)
  212.         halt()
  213.       end if
  214.     end if
  215.   end if
  216. end
  217.  
  218. on setSavePuppets
  219.   set the castNum of sprite 12 to 164
  220.   set the castNum of sprite 14 to 166
  221. end
  222.  
  223. on flashCenterSpeaker
  224.   set the castNum of sprite 14 to cast "Center Speaker Highlight"
  225. end
  226.  
  227. on normalCenterSpeaker
  228.   set the castNum of sprite 14 to cast "Center Speaker"
  229. end
  230.  
  231. on highlightCenterSpeaker
  232.   set the castNum of sprite 14 to cast "Center Speaker Cycle"
  233. end
  234.  
  235. on setPuppetScore c
  236.   if c = #blank then
  237.     set the castNum of sprite 15 to cast "Score Blank"
  238.   else
  239.     if c = #smiley then
  240.       set the castNum of sprite 15 to cast "Score Smiley"
  241.     else
  242.       if c = #check then
  243.         set the castNum of sprite 15 to cast "Score Check"
  244.       end if
  245.     end if
  246.   end if
  247. end
  248.  
  249. on setTogglePuppet c
  250.   set the castNum of sprite 18 to cast c
  251. end
  252.  
  253. on highlightYeahSnd which
  254.   set h to 160 + ((which - 1) mod 4 * 39)
  255.   set v to 170 + ((which - 1) / 4 * 36)
  256.   set the locH of sprite 18 to h
  257.   set the locV of sprite 18 to v
  258. end
  259.  
  260. on highlightNoSnd which
  261.   set h to 160 + ((which - 1) mod 4 * 39)
  262.   set v to 250 + ((which - 1) / 4 * 36)
  263.   set the locH of sprite 19 to h
  264.   set the locV of sprite 19 to v
  265. end
  266.  
  267. on showScorePuppet show
  268.   if show then
  269.     set the locH of sprite 19 to 438
  270.     set the locH of sprite 20 to 479
  271.   else
  272.     set the locH of sprite 19 to 1000
  273.     set the locH of sprite 20 to 1000
  274.   end if
  275. end
  276.  
  277. on drawModePuppet isChallenge
  278.   if isChallenge then
  279.     set the castNum of sprite 21 to cast "ModeType"
  280.     set the locH of sprite 21 to 492
  281.     set the locV of sprite 21 to 79
  282.   else
  283.     set the castNum of sprite 21 to cast "BrowseType"
  284.     set the locH of sprite 21 to 432
  285.     set the locV of sprite 21 to 77
  286.   end if
  287. end
  288.  
  289. on setFlagsPuppet c
  290.   set the castNum of sprite 22 to c
  291. end
  292.  
  293. on showMike
  294.   set the castNum of sprite 25 to cast "mike"
  295.   set the locH of sprite 25 to 473
  296. end
  297.  
  298. on showShowText
  299.   set the castNum of sprite 26 to cast "Browse A Text off"
  300.   set the locH of sprite 26 to 473
  301. end
  302.  
  303. on setMercury x
  304.   spriteBox(29, 347, 308, 357, 308 - (x * 9 / 5))
  305. end
  306.  
  307. on showDict which
  308.   set the locH of sprite 30 to 215
  309.   set the locH of sprite 31 to 352
  310.   set the locH of sprite 32 to 45
  311.   set the locH of sprite 33 to 352
  312.   set the castNum of sprite 30 to cast "dict text box"
  313.   set the castNum of sprite 31 to 201
  314.   set the castNum of sprite 32 to cast "dict text"
  315.   set the castNum of sprite 33 to cast "dict check"
  316.   if which > 2 then
  317.     set the locV of sprite 30 to 121
  318.     set the locV of sprite 31 to 140
  319.     set the locV of sprite 32 to 73
  320.     set the locV of sprite 33 to 104
  321.   else
  322.     set the locV of sprite 30 to 318
  323.     set the locV of sprite 31 to 337
  324.     set the locV of sprite 32 to 271
  325.     set the locV of sprite 33 to 301
  326.   end if
  327.   set the text of cast "dict text" to EMPTY
  328.   set the keyDownScript to "handleDictKey"
  329. end
  330.  
  331. on hideDict
  332.   set the locH of sprite 30 to 1000
  333.   set the locH of sprite 31 to 1000
  334.   set the locH of sprite 32 to 1000
  335.   set the locH of sprite 33 to 1000
  336.   set the editableText of sprite 32 to 0
  337.   set the castNum of sprite 32 to 29
  338.   set the keyDownScript to "handlekey"
  339. end
  340.  
  341. on showjumpcontrol
  342.   set the ink of sprite 46 to 0
  343.   set the locH of sprite 46 to 260
  344.   set the locV of sprite 46 to 190
  345.   set the castNum of sprite 46 to cast "Jump Control"
  346. end
  347.  
  348. on hideJumpControl
  349.   set the locH of sprite 46 to 1000
  350. end
  351.  
  352. on hideOverlay
  353.   set the locH of sprite 47 to 1000
  354. end
  355.  
  356. on highlightSpeaker x
  357.   set h to the locH of sprite 14
  358.   set v to the locV of sprite 14
  359.   set the castNum of sprite 47 to value(item x of "218,222,220,224")
  360.   set the locH of sprite 47 to h + item x of "-40,2,-40,2"
  361.   set the locV of sprite 47 to v + item x of "-37,-37,2,2"
  362. end
  363.  
  364. on highlightDictSpeaker x
  365.   set the castNum of sprite 47 to value(item x of "208,209,208,209")
  366.   set the locH of sprite 47 to value(item x of "177,219,177,219")
  367.   set the locV of sprite 47 to value(item x of "183,183,222,222")
  368. end
  369.  
  370. on setOverlayPuppet h, v, c
  371.   set the locH of sprite 47 to h
  372.   set the locV of sprite 47 to v
  373.   set the castNum of sprite 47 to c
  374. end
  375.  
  376. on alignYesNo which, icon
  377.   global gStuMethod
  378.   if which = 0 then
  379.     set the locH of sprite 47 to the locH of sprite 30
  380.     set the locV of sprite 47 to the locV of sprite 30
  381.   else
  382.     if which = -1 then
  383.       set the locH of sprite 47 to 400
  384.       set the locV of sprite 47 to 260
  385.     else
  386.       set the locH of sprite 47 to the locH of sprite (which + 1)
  387.       set the locV of sprite 47 to the locV of sprite (which + 1)
  388.     end if
  389.   end if
  390.   if getaProp(gStuMethod, #icons) = #smiley then
  391.     set i to "smileyface"
  392.   else
  393.     set i to "checkmark"
  394.   end if
  395.   if icon = #YES then
  396.     set the castNum of sprite 47 to cast i
  397.   else
  398.     if icon = #no then
  399.       set the castNum of sprite 47 to cast (the number of cast i + 1)
  400.     else
  401.       set the castNum of sprite 47 to cast "timeout icon"
  402.     end if
  403.   end if
  404. end
  405.  
  406. on initMouseTrap
  407.   setPuppets("48")
  408.   set the lineSize of sprite 48 to 0
  409. end
  410.  
  411. on setMouseTrap
  412.   set the visible of sprite 48 to 1
  413. end
  414.  
  415. on stopMouseTrap
  416.   set the visible of sprite 48 to 0
  417. end
  418.  
  419. on checkPuppet proc, x
  420.   if the puppet of sprite x = 0 then
  421.     alert(proc & ": Not puppetsprite!" && x)
  422.     halt()
  423.   end if
  424. end
  425.  
  426. on dumpSprite x
  427.   set st to " - "
  428.   put the backColor of sprite x after st
  429.   put ";" after st
  430.   put the blend of sprite x after st
  431.   put ";" after st
  432.   put the bottom of sprite x after st
  433.   put ";" after st
  434.   put the castNum of sprite x after st
  435.   put ";" after st
  436.   put the constraint of sprite x after st
  437.   put ";" after st
  438.   put the cursor of sprite x after st
  439.   put ";" after st
  440.   put the editableText of sprite x after st
  441.   put ";" after st
  442.   put the foreColor of sprite x after st
  443.   put ";" after st
  444.   put the height of sprite x after st
  445.   put ";" after st
  446.   put the ink of sprite x after st
  447.   put ";" after st
  448.   put the left of sprite x after st
  449.   put ";" after st
  450.   put the lineSize of sprite x after st
  451.   put ";loch=" after st
  452.   put the locH of sprite x after st
  453.   put ";" after st
  454.   put the locV of sprite x after st
  455.   put ";" after st
  456.   put the moveableSprite of sprite x after st
  457.   put ";" after st
  458.   put the puppet of sprite x after st
  459.   put ";" after st
  460.   put the right of sprite x after st
  461.   put ";" after st
  462.   put the scoreColor of sprite x after st
  463.   put ";" after st
  464.   put the scriptNum of sprite x after st
  465.   put ";" after st
  466.   put the stretch of sprite x after st
  467.   put ";" after st
  468.   put the top of sprite x after st
  469.   put ";" after st
  470.   put the trails of sprite x after st
  471.   put ";" after st
  472.   put the type of sprite x after st
  473.   put ";" after st
  474.   put the visible of sprite x after st
  475.   put ";" after st
  476.   put the width of sprite x after st
  477.   put ";" after st
  478.   put "Sprite: " & x && st
  479. end
  480.